package com.sptus.entity;

import com.sptus.common.utils.StringUtils;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@Data

public class BBPS {
    //并包个数
    String numberOfBundles;
    //平均SOH
    String averageSOH ;
    //电池平均循环次数
    String AverageNumberOfBatteryCycles;

    //总体过压保护状态
     String OverallOvervoltageProtectionState;


    //总体欠压保护状态
    String OverallUndervoltageProtectionState;

    //单体过压保护状态
    String cellOvervoltageProtectionState;

    //单体欠压保护状态
    String cellUndervoltageProtectionState;
    //充电电流保护状态
    String chargingCurrentProtectionState;
    //放电电流保护状态
    String dischargeVoltageProtectionState;

    //总体充电温度保护状态
    String overallChargingTemperatureProtectionState;

    //总体放电温度保护状态
    String overallDischargingTemperatureProtectionState;

    //电芯充电温度保护状态
    String BatteryChargingTemperatureProtectionState;
    //电芯放电温度保护状态
    String BatteryDischargingTemperatureProtectionState;

    //MOS温度保护状态
    String MOSTemperatureProtectedState;
    //短路保护状态
    String ShortCircuitProtectionCondition;

    public BBPS(String bbps){
        if (!StringUtils.isEmpty(bbps)){
          String[] bbpsArr= bbps.split(";");
          this.numberOfBundles = bbpsArr[0];
          this.averageSOH = bbpsArr[1];
          this.AverageNumberOfBatteryCycles = bbpsArr[2];
          this.OverallOvervoltageProtectionState = bbpsArr[3];
          this.OverallUndervoltageProtectionState = bbpsArr[4];
          this.cellOvervoltageProtectionState = bbpsArr[5];
          this.cellUndervoltageProtectionState = bbpsArr[6];
          this.chargingCurrentProtectionState = bbpsArr[7];
          this.dischargeVoltageProtectionState = bbpsArr[8];
          this.overallChargingTemperatureProtectionState = bbpsArr[9];
          this.overallDischargingTemperatureProtectionState = bbpsArr[10];
          this.BatteryChargingTemperatureProtectionState = bbpsArr[11];
          this.BatteryDischargingTemperatureProtectionState = bbpsArr[12];
          this.MOSTemperatureProtectedState = bbpsArr[13];
          this.ShortCircuitProtectionCondition = bbpsArr[14];
        }

    }
}
